package com.fsj.miniapp.api;

import com.alibaba.fastjson.JSONObject;
import com.fsj.miniapp.service.BannerService;
import com.fsj.miniapp.vo.BannerVo;
import com.fsj.miniapp.vo.Json;
import com.google.gson.JsonObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/banner")
public class BannerController {

    @Autowired
    private BannerService bannerService;

    @GetMapping("list")
    public Json list(Long merchantId) {
        List<BannerVo> bannerVo = bannerService.listFor(merchantId);
        return Json.succ("banner list").data("data", bannerVo);

    }
}
